|
|
|
|
|
|
|
1 dbgColumnNavigationPressing the Tab key moves to the next cell in the current row of the DataGrid. Pressing Shift+Tab moves to the previous cell. When you reach the last cell in the row, Tab moves out of the grid to the next control on the form. To move to a different row, you must use the arrow keys or mouse. |
|
|
|
|
|
|
|
|
2 dbgGridNavigationThis setting by itself is not very different from dboColumnNavigation, but it allows you to set two other properties to further control the behavior of the Tab key: TabAcrossSplits and WrapCellPointer. Setting WrapCellPointer to True allows you to use the Tab key to move between rows on the grid. If TabAcrossSplits is set to True, then you can use the Tab or arrow keys to move between splits (sections) on the grid. |
|
|
|
|
|
|
|
|
Although a DataGrid generally has only one underlying set of data, you can split the grid into several sections. These sections, which are known as splits, behave much like sub-grids within a single DataGrid control. Refer to Figure 28.9 for an example of splits. The Title field is in a separate split from the other fields, allowing it to remain locked while you scroll horizontally through the other splits. |
|
|
|
|
|
|
|
|
|
Even if a DataGrid contains multiple splits, you still have only one current record. Splits are not as complicated as they sound; just think of them as areas of the grid that can be formatted individually.  |
|
|
|
|
|
|
|
|
|
|
Editing the Grid at Designtime |
|
|
|
|
|
|
|
|
To add or remove splits at designtime, you must go into the grid's design-environment editing mode. To do so, right-click the DataGrid control as you would to bring up the Property Pages. However, instead of selecting Properties, choose Edit from the context menu. Nothing appears to happen, but if you right-click again in the DataGrid, you will notice that the items on the context menu change from Visual Basic's to those provided by the DataGrid. While you're in this design-environment editing mode, you can perform the following operations from the context menu: |
|
|
|
|
|
|
|
|
Insert and delete columns |
|
|
|
|
|
|
|
|
Retrieve the field layout from the data source |
|
|
|
|
|
|
|
|
Clear the existing field layout |
|
|
|
|
|
|
|
|
By default, the DataGrid has only a single split, Split0, as pictured in Figure 28.11. To add a split, right-click the DataGrid while in the previously described editing mode, and choose Split from the context menu. An additional section is then added to the grid (also shown in Figure 28.11). |
|
|
|
|
|
|
|
|
After creating a new split, you can continue to use the context menu to delete and add columns to the splits on the DataGrid. |
|
|
|
|
|